#pragma once
#include <string>
#include <iostream>
#include "ResultRegister.h"
using namespace std;
class Course
{
public:
	Course(void){}
	~Course(void);
	void SetCourseName(string cName){courseName = cName;}
	string GetCourseName(){return courseName;}
	friend ostream& operator<<(ostream &out, Course &c)
	{
		out << "(" << c.courseName << ")" << endl;
		out << c.ListResults();
		return out;
	}
	friend istream& operator>>(istream &in, Course &c)
	{
		string str;
		getline(in,str,'(');
		getline(in,c.courseName,')');
		getline(in,str);
		return in;
	}
	void Read()
	{
		cout << "Ange kursnamnet: ";
		getline(cin,courseName);
	}
	string ListResults()
	{
		ostringstream oss(rr.List());
		return oss.str();
	}
	void AddResult()
	{
		Result r;
		r.Read();
		rr.Add(r);
	}
	void AddResultObjekt(Result r)
	{
		rr.Add(r);
	}
	void ClearResult()
	{
		rr.Clear();
	}
private:
	string courseName;
	ResultRegister rr;
	
};

